package com.jyg.feign.clients;


//import com.jyg.feign.clients.fallback.UserClientFallbackFactory;

import com.jyg.feign.clients.fallback.UserClientFallbackFactory;
import com.jyg.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

//服务名称
@FeignClient(value = "userservice", fallbackFactory = UserClientFallbackFactory.class)
//@FeignClient(value = "userservice")
//局部生效
//@FeignClient(value = "userservice", configuration = DefaultFeignConfiguration.class)
@RequestMapping("/user")
public interface UserClient {

    @GetMapping("/{id}")
    User findById(@PathVariable("id") Long id,
                  @RequestHeader(value = "Truth", required = false) String truth);
}
